<?php
	require_once('logic\connection.php');
	$res=$con->prepare("select title, author, publisher, price, isbn, image, file_path from book_info");
	$res->execute();	
	$res->bind_result($title, $author, $publisher, $price, $isbn, $image, $file_path);
?>
<!doctype html>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7" lang="en"> <![endif]-->
<!--[if IE 7]>    <html class="no-js lt-ie9 lt-ie8" lang="en"> <![endif]-->
<!--[if IE 8]>    <html class="no-js lt-ie9" lang="en"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en"> <!--<![endif]-->
<head>
	<meta charset="utf-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">

	<title></title>
	<meta name="description" content="">
	<meta name="author" content="">

	<meta name="viewport" content="width=device-width">

	<link rel="stylesheet" href="css/bootstrap.min.css">
	<style>
	body {
	  padding-top: 60px;
	  padding-bottom: 40px;
	}
	</style>
	<link rel="stylesheet" href="css/bootstrap-responsive.min.css">
	<link rel="stylesheet" href="css/style.css">
	
	<script src="js/libs/modernizr-2.5.3-respond-1.1.0.min.js"></script>
</head>
<body>
<!--[if lt IE 7]><p class=chromeframe>Your browser is <em>ancient!</em> <a href="http://browsehappy.com/">Upgrade to a different browser</a> or <a href="http://www.google.com/chromeframe/?redirect=true">install Google Chrome Frame</a> to experience this site.</p><![endif]-->

    <div class="navbar navbar-fixed-top">
      <div class="navbar-inner">
        <div class="container">
          <a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
          </a>
          <a class="brand" href="index.php">E-library</a>
          <div class="nav-collapse">
            <ul class="nav">
              <li class="active"><a href="index.php">Home</a></li>
              <?php session_start(); 
               if(isset($_SESSION['user_id'])){ ?>
				  
				 <li><a href="addcredit.php">Add Credit</a></li>
				  <li><a href="logic/logout.php">Log Out</a></li>
                   <li><a href="my-downloads.php">My Downloads</a></li>
                  
                  <?php
				   } 
				  else {
				  ?>
				  <li><a href="register.php">Register</a></li>
				  <li><a href="login.php">Log In</a></li>
                  
                  <?php }?>
			 
            </ul>
          </div><!--/.nav-collapse -->
        </div>
      </div>
    </div>

    <div class="container">

       <div>
    <?php
			while($row=$res->fetch())
			{
		?>
    	<form method="post" action="download-book.php">
        <div class="book">
          <div class="pull-left"> <img alt="" src="img/<?php echo $image; ?>" class="" ></div>
          <div  class="clearfix">
            <p class="title"><?php echo $title; ?></p>
            <p class="auhor">By, <?php echo $author; ?></p>
            <p class="publisher">Published by, <?php echo $publisher; ?></p>
            <p class="isbn">ISBN: <?php echo $isbn; ?></p>
            <input type="hidden" value="<?php echo $isbn; ?>" name="isbn">
	      </div>
          <div><span class="price"><?php echo $price; ?></span>
        	<input type="submit" name="submit" value="Buy This Book">
      		</div>
        
	  </div>
  	</form>
      <?php
			}
		
		?>
        
      <div class="clearfix"></div>
      
      
      <hr>

      <footer>
        <p>&copy; Company 2012</p>
      </footer>

	

    </div> <!-- /container -->

</body>
</html>
